home *** CD-ROM | disk | FTP | other *** search
/ Sun Solutions 2000 #2 / Sun Solutions CD (Volume 2 2000)(Special Focus - Java Technologies)(Disc 1).ISO / products / bin / optfinish.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  2000-01-05  |  3KB  |  98 lines

  1. #!/bin/sh 
  2. #
  3. #cmdtool $CD_MOUNT/find.sh
  4.  
  5. #echo "bef"
  6. #kill -9 $PID_AUDIO
  7. #echo "after"
  8. if [ "$NETSCAPE_CATALYST" != "" ]; then
  9.     if [ -r $NETSCAPE_CATALYST ]; then
  10.         echo "Netscape is starting: using  "$NETSCAPE_CATALYST "..."
  11.         $NETSCAPE_CATALYST -xrm "*useStderrDialog: False" -xrm "*strings.22130:This process will either launch\na demo from the Sun Solutions CD.\n\nProceed?\n" -geometry =665x770+0+0 $WWW_FIRST 2>&-
  12.     else
  13.         echo "Cannot execute $NETSCAPE_CATALYST";
  14.     fi
  15. else
  16.     echo "Netscape is starting... "    
  17.  
  18.     if [ "$DEVCD_ENV" != "Solaris_1" ]; then
  19.  
  20.         $CD_MOUNT/.products/.bin/gui/$DEVCD_ENV/netscape -xrm "*useStderrDialog: False" -xrm "*strings.22130:This process will launch\na demo from the Sun Solutions CD.\n\nProceed?\n" -geometry =660x775+0+0 $WWW_FIRST 2>&-
  21.     else
  22.         $CD_MOUNT/.products/.bin/gui/$DEVCD_ENV/$SUNOS_VER/netscape -xrm "*useStderrDialog: False" -xrm "*strings.22130:This process will launch\na demo from the Sun Solutions CD.\n\nProceed?\n" -geometry =660x775+0+0 $WWW_FIRST 2>&-
  23.     fi
  24. fi
  25.  
  26.         
  27. #
  28. # clean-up
  29. #
  30. if [ -w /dev/audio ]; then 
  31.     if [ $DEVCD_ENV != "Solaris_1" ]; then
  32.             audioplay -i $CD_MOUNT/.products/DEVCD/audio/thanks.au&
  33.     else
  34.             cat $CD_MOUNT/.products/DEVCD/audio/thanks.au > /dev/audio&
  35.     fi
  36. fi
  37.  
  38.    perl -e '
  39. if (-s "$ENV{\"HOME\"}/.netscape/preferences.SunCD") {
  40.     if (open(PREFFILE, "$ENV{\"HOME\"}/.netscape/preferences.SunCD")) {
  41.         while (<PREFFILE>) {
  42.             if (/^([^:]*):([     ]*.*)$/) {
  43.                 $Params{$1} = $2;
  44.             }
  45.         }
  46.         close(PREFFILE);
  47.     }
  48.     if (open(PREFFILE, "$ENV{\"HOME\"}/.netscape/preferences") && open(NEWPREFFILE, ">$ENV{\"HOME\"}/.netscape/preferences.NewCD")) {
  49.         while (<PREFFILE>) {
  50.             if (m?^(AUTOLOAD_IMAGES):[     ]*True?
  51.             || m?^(DISABLE_JAVA):[     ]*False?
  52.             || m?^(DISK_CACHE_SIZE):[     ]*3000?
  53.             || m?^(FTP_FILE_INFO):[     ]*True?
  54.             || m?^(HOME_DOCUMENT):[     ]*$ENV{"WWW_HOME"}?
  55.             || m?^(MEMORY_CACHE_SIZE):[     ]*1000?
  56.             || m?^(NO_PROXY):[     ]*localhost?
  57.             || m?^(PERSONAL_MAILCAP):[     ]*/opt/ns-home/docs/demo/.DEVCD_mailcap?
  58.             || m?^(PERSONAL_MIME_TYPES):[     ]*/opt/ns-home/docs/demo/conf/mime.types?
  59.             || m?^(PROXY_MODE):[     ]*1?
  60.             || m?^(SHOW_DIRECTORY_BUTTONS):[     ]*False?
  61.             || m?^(SHOW_SECURITY_BAR):[     ]*True?
  62.             || m?^(SHOW_TOOLBAR):[     ]*True?
  63.             || m?^(SHOW_URL):[     ]*True?
  64.             ) {
  65.                 print NEWPREFFILE "$1:$Params{$1}\n";
  66.             } else {
  67.                 print NEWPREFFILE;
  68.             }
  69.         }
  70.         close(PREFFILE);
  71.         close(NEWPREFFILE);
  72.         rename("$ENV{\"HOME\"}/.netscape/preferences.NewCD", "$ENV{\"HOME\"}/.netscape/preferences");
  73.         unlink("$ENV{\"HOME\"}/.netscape/preferences.SunCD");
  74.     }
  75. }
  76. '
  77.  
  78. # kill httpd
  79. if [ -r /opt/ns-home/docs/demo/logs/httpd.pid ]; then
  80.     kill -9 `cat /opt/ns-home/docs/demo/logs/httpd.pid`
  81. fi
  82.  
  83.  
  84. if [ -h $HOME/.netscape/lock ]; then
  85.     echo "Netscape seems to have crashed. Removing $HOME/.netscape/lock file."
  86.     echo
  87.     rm -rf $HOME/.netscape/lock
  88. fi
  89.  
  90. # remove httpd config
  91. # remove glimpse directory 
  92. #if [ -d /opt/ns-home/docs/demo ]; then
  93.     #echo "removing /opt/ns-home/docs/demo directory"
  94.     #rm -rf /opt/ns-home/docs/demo
  95. #fi
  96.  
  97. exit 0
  98.